<template>
  <div>
    <h1>测试组件v-if强制刷新</h1>
    <div class="box"></div>
  </div>
</template>

<script>
export default {
  beforeCreate() {
    console.log("V_ifbeforeCreate");
  },
  created() {
    console.log("V_ifcreated");
  },
  beforeMount() {
    console.log("V_ifbeforeMount");
  },
  mounted() {
    console.log("V_ifmounted");
  },
  beforeUpdate() {
    console.log("V_ifbeforeUpdate");
  },
  updated() {
    console.log("V_ifupdated");
  },
  beforeDestroy() {
    console.log("V_ifbeforeDestroy");
  },
  destroyed() {
    console.log("V_ifdestroyed");
  },
};
</script>

<style lang="scss" scoped>
div {
  .box {
    width: 100px;
    height: 100px;
    background-color: yellow;
  }
}
</style>